/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import da.AccountJpaController;

import entities.Account;
import javax.ejb.Stateless;

/**
 *
 * @author QUY_THI
 */
@Stateless
public class AccountChangePass implements AccountChangePassRemote {

    public boolean changePass(Account account, String newpass) {
        boolean check = false;
        try {

            AccountJpaController acc = new AccountJpaController();
            String pass = EncryptMD5.getHashString(newpass);
            account.setPinCode(pass);
            acc.edit(account);
            check = true;
        } catch (Exception ex) {
            check = false;
        }
        return check;
    }

}
